//package com.allwees.data.dataport.module.product.doc;
//
//import java.io.Serializable;
//import java.math.BigDecimal;
//
//import org.springframework.data.annotation.Id;
//import org.springframework.data.elasticsearch.annotations.Document;
//import org.springframework.data.elasticsearch.annotations.Field;
//import org.springframework.data.elasticsearch.annotations.FieldType;
//
//import com.allwees.bs.core.model.product.entity.ProductModel;
//import com.allwees.core.common.util.reflect.PojoUtil;
//
//import lombok.Data;
//
///**
// * ProductSpu
// *
// * @author yangylsky
// * @since 2019-11-19
// *
// */
//@Data
//@Document(indexName = "product_spu", type = "product_spu", replicas = 2, shards = 4)
//public class ProductSpu implements Serializable {
//	@Id
//    @Field(store = true, type = FieldType.Keyword)
//	private String uuid;
//
//    @Field(store = true, type = FieldType.Keyword)
//    private String storeUuid;
//
//    @Field(store = true, type = FieldType.Keyword)
//    private String retailerUuid;
//
//    @Field(store = true, type = FieldType.Keyword)
//	private String no;
//
//    @Field(store = true, type = FieldType.Keyword)
//    private String customNo;
//
//    @Field(store = true, type = FieldType.Keyword)
//    private String categoryNo;
//
//    @Field(store = true, type = FieldType.Text, analyzer = "english")
//	private String name;
//
//    @Field(type = FieldType.Text, analyzer = "english")
//	private String description;
//
//    @Field(store = true, type = FieldType.Text, analyzer = "english")
//	private String tags;
//
//    @Field(store = true, type = FieldType.Keyword)
//    private String mainPhoto;
//
//    @Field(store = true)
//	private BigDecimal originalPrice;
//
//    @Field(store = true)
//	private BigDecimal retailPrice;
//
//    @Field(store = true, type = FieldType.Keyword)
//	private String currency;
//
//    @Field(store = true)
//	private Integer quantity = 0;
//
//    @Field(store = true)
//	private Float rating = 0.0f;
//
//    @Field(store = true)
//	private Integer totalSales = 0;
//
//    @Field(store = true)
//	private Integer totalCollections = 0;
//
//    @Field(store = true)
//	private Integer totalReviews = 0;
//
//    @Field(store = true)
//	private Integer totalShares = 0;
//
//    @Field(store = true)
//	private Integer totalViews = 0;
//
//    @Field(store = true, type = FieldType.Keyword)
//    private String totalReviewsDesc;
//
//    @Field(store = true, type = FieldType.Keyword)
//    private String totalSalesDesc;
//
//	@Field(store = true)
//    private BigDecimal refundRate = BigDecimal.ZERO;
//
//	@Field(store = true)
//    private BigDecimal originalScore = BigDecimal.ZERO;
//
//	@Field(store = true)
//    private Long posIdx = 9999L;
//
//	private Integer status = 0;
//
//	@Field(store = true)
//	private Long publishAt;
//
//	private Long createdAt;
//
//	private Long updatedAt;
//
//	private Long deletedAt;
//
//	private Integer isDeleted = 0;
//
//    public static ProductSpu fromProductModel(ProductModel product) {
//    	ProductSpu productSpu = PojoUtil.copy(new ProductSpu(), product);
//    	productSpu.setPublishAt(product.getPublishAt() == null ? null : product.getPublishAt().getTime());
//    	productSpu.setCreatedAt(product.getCreatedAt() == null ? null : product.getCreatedAt().getTime());
//    	productSpu.setUpdatedAt(product.getUpdatedAt() == null ? null : product.getUpdatedAt().getTime());
//    	productSpu.setDeletedAt(product.getDeletedAt() == null ? null : product.getDeletedAt().getTime());
//    	return productSpu;
//    }
//}
